﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Zxgl_HistoryCompare.aspx.cs" Inherits="Zxgl_HistoryCompare" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>

    <script src="js/jquery-1.8.0.min.js"></script>
    <link rel="stylesheet" href="css_zxgl/reset.css" />
  <link href="App_Themes/css/i6Fzam6N7fIj.css" rel="stylesheet" />
    <link rel="stylesheet" href="css_zxgl/filterbase.css" />
    <link rel="stylesheet" href="css_zxgl/ssq_filter.css" />
    <script>
        //单选按钮
        function CheckValue(QScount) {
            if (QScount == 30) {
                $("#checkValue").text("最近30期");
                $("#QS").text(QScount);
            } else if (QScount == 50) {
                $("#checkValue").text("最近50期");
                $("#QS").text(QScount);
            } else if (QScount == 100) {
                $("#checkValue").text("最近100期");
                $("#QS").text(QScount);
            } else if (QScount == 300) {
                $("#checkValue").text("最近300期");
                $("#QS").text(QScount);
            } else if (QScount == 0) {
                $("#checkValue").text("历史所有期");
                $.ajax({
                    url: "/Ajax/GetAllCountQS.ashx",
                    type: "POST",
                    data: { type: 1 },
                    success: function (AllQsCount) {
                        $("#QS").text(AllQsCount);
                    }
                });

            }
            document.getElementById('result').style.display = 'none';//隐藏
            document.getElementById('Default').style.display = 'none';//隐藏  
            document.getElementById('check').style.display = 'block';//显示  
        }
        //开始对比
        function StartCompare() {
            document.getElementById('Default').style.display = 'none';//隐藏  
            document.getElementById('result').style.display = 'block';//隐藏  
            document.getElementById('check').style.display = 'none';//显示  
            $.ajax({
                url: "/Ajax/ZxglAjax.ashx",
                type: "post",
                data:
                    { t: "historyCompare", QS: $("#QS").text() },
                //dataType: "json",
                success: function divHide(ResultList) {
                    var Dj1 = "", Dj2 = "", Dj3 = "", Dj4 = "", Dj5 = "", Dj6 = "";
                    var oneCount = 0, twoCount = 0, threeCount = 0, fourCount = 0, fiveCount = 0, sixCount = 0;
                    var oneGS = 0, twoGS = 0, threeGS = 0, fourGS = 0, fiveGS = 0, sixGS = 0;//中奖个数
                    $("#Dj1").html("");
                    $("#Dj2").html("");
                    $("#Dj3").html("");
                    $("#Dj4").html("");
                    $("#Dj5").html("");
                    $("#Dj6").html("");
                    $("#resultList").html("");
                    for (var i = 0; i < eval(ResultList).length; i++) {
                        var strRedBall = $("#strRedBalls").text();
                        var strBlueBall = $("#strBlueBalls").text();
                        var redBall = eval(ResultList)[i].LotteryNo.split("+");
                        var strQS = eval(ResultList)[i].LotteryQS;
                        var red = redBall[0].replace(/\,/g, " ");//全局匹配豆
                        var ID = eval(ResultList)[i].id;//iD为几，对应几等奖
                        if (ID == 1) {//一等奖
                            oneCount += 1;
                            if (oneCount == 1) {
                                Dj1 += "<li class=\"\"><p><i class=\"ico ico-libefore\"></i>"
                                     + "<span class=\"number\">一等奖：<b class=\"red\" id=\"oneCount\">" + oneGS++ + "</b>次</span>"
                                     + "<span class=\"bonus-hign\">单注最高奖金：<b>500万</b>元</span>"
                                     + "<i class=\"ico ico-liafter\" title=\"点击展开\"></i></p> <div class=\"code-show\"><span class=\"coner\"></span><ul>"
                                Dj1 += "<li><span class=\"date\">" + eval(ResultList)[i].LotteryQS + "期开奖</span><span class=\"numlist\">"
                                       //+ "<em class=\"red\">" + red + "</em>"
                                       //+ "|<em>" + redBall[1] + "</em></span>"
                                        + DrawRedBall(strRedBall, red)
                                        + "| " + DrawBlueBall(strBlueBall, redBall[1])
                                       + "</span>"
                                       + "<span class=\"bonus\">奖金：500万元</span></li>"
                            }
                            else {
                                if (oneCount < 5) {
                                    Dj1 += "<li><span class=\"date\">" + eval(ResultList)[i].LotteryQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                        //+ "|<em>" + redBall[1] + "</em></span>"
                                         + DrawRedBall(strRedBall, red)
                                        + "| " + DrawBlueBall(strBlueBall, redBall[1])
                                       + "</span>"
                                        + "<span class=\"bonus\">奖金：500万元</span></li>"
                                }
                                else if (oneCount == 5) {
                                    Dj1 += "<li class=\"muted\">最多显示4期</li><li></li>"
                                }
                            }
                        }
                        else if (ID == 2) {//二等奖
                            twoCount += 1;
                            if (twoCount == 1) {
                                Dj2 += "<li class=\"\"><p><i class=\"ico ico-libefore\"></i>"
                                     + "<span class=\"number\">一等奖：<b class=\"red\" id=\"twoCount\">" + twoGS++ + "</b>次</span>"
                                     + "<span class=\"bonus-hign\">单注最高奖金：<b>6000</b>元</span>"
                                     + "<i class=\"ico ico-liafter\" title=\"点击展开\"></i></p> <div class=\"code-show\"><span class=\"coner\"></span><ul>"
                                Dj2 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                        //+ "|<em>" + redBall[1] + "</em></span>"
                                         + DrawRedBall(strRedBall, red)
                                        + "| " + DrawBlueBall(strBlueBall, redBall[1])
                                       + "</span>"
                                        + "<span class=\"bonus\">奖金：6000元</span></li>"
                            }
                            else {
                                if (twoCount < 5) {
                                    Dj2 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                        //+ "|<em>" + redBall[1] + "</em></span>"
                                         + DrawRedBall(strRedBall, red)
                                        + "| " + DrawBlueBall(strBlueBall, redBall[1])
                                       + "</span>"
                                        + "<span class=\"bonus\">奖金：6000元</span></li>"
                                }
                                else if (twoCount == 5) {
                                    Dj2 += "<li class=\"muted\">最多显示4期</li><li></li>"
                                }
                            }
                        }
                        else if (ID == 3) {//三等奖
                            threeCount += 1;
                            if (threeCount == 1) {
                                Dj3 += " <li class=\"\"><p><i class=\"ico ico-libefore\"></i>"
                                     + "<span class=\"number\">三等奖：<b class=\"red\" id=\"threeCount\">" + threeGS++ + "</b>次</span>"
                                     + "<span class=\"bonus-hign\">单注最高奖金：<b>3000</b>元</span>"
                                     + "<i class=\"ico ico-liafter\" title=\"点击展开\"></i></p> <div class=\"code-show\"><span class=\"coner\"></span><ul>"
                                Dj3 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                       //+ "<em class=\"red\">" + red + "</em>"
                                       //+ "|<em>" + redBall[1] + "</em></span>"
                                        + DrawRedBall(strRedBall, red)
                                        + "| " + DrawBlueBall(strBlueBall, redBall[1])
                                       + "</span>"
                                       + "<span class=\"bonus\">奖金：3000元</span></li>"
                            }
                            else {
                                if (threeCount < 5) {
                                    Dj3 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                        //+ "|<em>" + redBall[1] + "</em></span>"
                                         + DrawRedBall(strRedBall, red)
                                        + "| " + DrawBlueBall(strBlueBall, redBall[1])
                                       + "</span>"
                                        + "<span class=\"bonus\">奖金：3000元</span></li>"
                                }
                                else if (threeCount == 5) {
                                    Dj3 += "<li class=\"muted\">最多显示4期</li><li></li>"
                                }
                            }
                        }
                        else if (ID == 4) {//四等奖
                            fourCount += 1;
                            if (fourCount == 1) {
                                Dj4 += " <li class=\"\"><p><i class=\"ico ico-libefore\"></i>"
                                     + "<span class=\"number\">四等奖：<b class=\"red\" id=\"fourCount\">" + fourGS++ + "</b>次</span>"
                                     + "<span class=\"bonus-hign\">单注最高奖金：<b>200</b>元</span>"
                                     + "<i class=\"ico ico-liafter\" title=\"点击展开\"></i></p> <div class=\"code-show\"><span class=\"coner\"></span><ul>"
                                Dj4 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                        //+ "|<em>" + redBall[1] + "</em></span>"
                                          + DrawRedBall(strRedBall, red)
                                        + "| " + DrawBlueBall(strBlueBall, redBall[1])
                                       + "</span>"
                                        + "<span class=\"bonus\">奖金：200元</span></li>"
                            }
                            else {
                                if (fourCount < 5) {
                                    Dj4 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                        //+ "|<em>" + redBall[1] + "</em></span>"
                                         + DrawRedBall(strRedBall, red)
                                        + "| " + DrawBlueBall(strBlueBall, redBall[1])
                                       + "</span>"
                                        + "<span class=\"bonus\">奖金：200元</span></li>"
                                }
                                else if (fourCount == 5) {
                                    Dj4 += "<li class=\"muted\">最多显示4期</li><li></li>"
                                }
                            }
                        }
                        else if (ID == 5) {//五等奖
                            fiveCount += 1;
                            if (fiveCount == 1) {
                                Dj5 += " <li class=\"\"><p><i class=\"ico ico-libefore\"></i>"
                                     + "<span class=\"number\">五等奖：<b class=\"red\" id=\"fiveCount\">" + fiveGS++ + "</b>次</span>"
                                     + "<span class=\"bonus-hign\">单注最高奖金：<b>10</b>元</span>"
                                     + "<i class=\"ico ico-liafter\" title=\"点击展开\"></i></p> <div class=\"code-show\"><span class=\"coner\"></span><ul>"
                                Dj5 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                        //+ "|<em>" + redBall[1] + "</em></span>"
                                        + DrawRedBall(strRedBall, red)
                                        + "| "
                                        + DrawBlueBall(strBlueBall, redBall[1])
                                        + "</span>"

                                        + "<span class=\"bonus\">奖金：10元</span></li>"
                            }
                            else {
                                if (fiveCount < 5) {
                                    Dj5 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                        //+ "|<em>" + redBall[1] + "</em></span>"
                                          + DrawRedBall(strRedBall, red)
                                          + "| "
                                          + DrawBlueBall(strBlueBall, redBall[1])
                                          + "</span>"

                                          + "<span class=\"bonus\">奖金：10元</span></li>"
                                }
                                else if (fiveCount == 5) {
                                    Dj5 += "<li class=\"muted\">最多显示4期</li><li></li>"
                                }
                            }
                        }
                        else if (ID == 6) {//六等奖
                            sixCount += 1;
                            if (sixCount == 1) {
                                Dj6 += "<li class=\"\"><p><i class=\"ico ico-libefore\"></i>"
                                     + "<span class=\"number\">六等奖：<b class=\"red\" id=\"sixCount\">" + sixGS++ + "</b>次</span>"
                                     + "<span class=\"bonus-hign\">单注最高奖金：<b>5</b>元</span>"
                                     + "<i class=\"ico ico-liafter\" title=\"点击展开\"></i></p> <div class=\"code-show\"><span class=\"coner\"></span><ul>"
                                Dj6 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                        + DrawRedBall(strRedBall, red)
                                        + "| " + DrawBlueBall(strBlueBall, redBall[1])
                                        //+ "|<em>" + redBall[1] + "</em></span>"
                                       + "</span>"
                                        + "<span class=\"bonus\">奖金：5元</span></li>"
                            }
                            else {
                                if (sixCount < 5) {
                                    Dj6 += "<li><span class=\"date\">" + strQS + "期开奖</span><span class=\"numlist\">"
                                        //+ "<em class=\"red\">" + red + "</em>"
                                           + DrawRedBall(strRedBall, red)
                                           + "| " +DrawBlueBall(strBlueBall, redBall[1])
                                        + "</span>"
                                        + "<span class=\"bonus\">奖金：5元</span></li>"
                                }
                                else if (sixCount == 5) {
                                    Dj6 += "<li class=\"muted\">最多显示4期</li><li></li>"
                                    continue;
                                }
                            }
                        }
                    }
                    if (oneCount != 0) {
                        Dj1 += "</ul></div></li>";
                        $("#resultList").append(Dj1);
                        $("#oneCount").text(oneCount);
                    }
                    if (twoCount != 0) {
                        Dj2 += "</ul></div></li>";
                        $("#resultList").append(Dj2);
                        $("#twoCount").text(twoCount);
                    }
                    if (threeCount != 0) {
                        Dj3 += "</ul></div></li>";
                        $("#resultList").append(Dj3);
                        $("#threeCount").text(threeCount);
                    }
                    if (fourCount != 0) {
                        Dj4 += "</ul></div></li>";
                        $("#resultList").append(Dj4);
                        $("#fourCount").text(fourCount);
                    }
                    if (fiveCount != 0) {
                        Dj5 += "</ul></div></li>";
                        $("#resultList").append(Dj5);
                        $("#fiveCount").text(fiveCount);
                    }
                    if (sixCount != 0) {
                        Dj6 += "</ul></div></li>";
                        $("#resultList").append(Dj6);
                        $("#sixCount").text(sixCount);
                    }
                    //对比后，点击收缩，查看效果
                    $(".compare-list>li>p").on("click", function (t) { t.preventDefault(), $(this).parent().toggleClass("active").siblings().removeClass("active") })

                }
            });
        }
        function DrawRedBall(strRedBall, red) {
           
            var fr = strRedBall.split(',');//选中号码
            var r = red.split(' ');//开奖号码
            var str = "";
            var temp1 = [];
            var temp2 = [];
            for (var j = 0; j < fr.length; j++) {
                temp1[fr[j]] = true;
            }
            for (var i = 0; i < r.length; i++) {
                if (!temp1[r[i]]) {
                    temp2.push(r[i]);
                    str += "<em>" + r[i] + "</em> ";
                }
                else {
                    str += "<em class=\"red\">" + r[i] + "</em> ";
                }
            }
            return str;
        }
        function DrawBlueBall(strBlueBall, blue) {
            var fb = strBlueBall.split(',');//选中号码
            var str = "";
            var n = {};//n为hash表
            for (var i = 0; i < fb.length; i++) {
                if (fb[i] == blue) {
                    if (!n[fb[i]]) {
                        n[fb[i]] = true;
                        str = "<em class=\"blue\">" + fb[i] + "</em>";
                    }
                }
                else {
                    if (!n[fb[i]]) {
                        n[fb[i]] = true;
                        str = "<em>" + fb[i] + "</em>";
                    }
                }
            }
            return str;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <div class="panel panel-t1 panel-compare">
                <div class="panel-content">
                    <div class="bd">
                        <div class="compare-cont">
                            <div class="compare-msg clearfix">
                                <asp:Label ID="strRedBalls" runat="server" Visible="true" ForeColor="Red"></asp:Label>

                                <span class="item fl">玩法：<b class="dbq-plays">单式</b></span>
                                <span class="item fl">合计：<b class="dbq-count"><%=zhushu%></b>注×<b><%=beishu%></b>倍</span>
                                <span class="item fl">金额：<b class="dbq-money"><%=zhushu*2*beishu%></b>元</span>
                                <span><a class="lnk fr" target="_blank" href="double_ball.aspx">体验专业版>></a></span>
                            </div>
                            <asp:Label ID="strBlueBalls" runat="server" Visible="true" ForeColor="Red"></asp:Label>
                            <div class="result">
                                <div class="content">
                                    <ul class="codelist-compare">
                                        <%if (LotteryArrayList.Count > 0)
                                            {
                                                for (int i = 0; i < LotteryArrayList.Count; i++)
                                                {%>
                                        <li>
                                            <div class="code">
                                                <b>单式</b>  <b class="em" style="color: red"><%=LotteryArrayList[i].ToString().Substring(0, LotteryArrayList[i].ToString().LastIndexOf(',')).Replace(',',' ')%></b><b style="color: blue"><%=LotteryArrayList[i].ToString().Substring(LotteryArrayList[i].ToString().LastIndexOf(',')).Replace(',', '+')%></b>[1注,<em class="code-list-money">2</em>元]
                                            </div>
                                        </li>
                                        <% }
                                            } %>
                                    </ul>
                                </div>
                            </div>
                            <div class="method">
                                <span class="v">对比最近</span>
                                <span class="k">
                                    <label>
                                        <input type="radio" value="0" name="issueCount" class="ipt-r" onclick="CheckValue(0)">所有期数</label>
                                    <label>
                                        <input type="radio" value="300" name="issueCount" class="ipt-r" checked="true" onclick="CheckValue(300)">300期</label>
                                    <label>
                                        <input type="radio" value="100" name="issueCount" class="ipt-r" onclick="CheckValue(100)">100期</label>
                                    <label>
                                        <input type="radio" value="50" name="issueCount" class="ipt-r" onclick="CheckValue(50)">50期</label>
                                    <label>
                                        <input type="radio" value="30" name="issueCount" class="ipt-r" onclick="CheckValue(30)">30期</label>
                                </span>
                            </div>
                            <div class="compare-ft">
                                <span class="btn-large btn-slt-ok"><i class="l"><i class="r" onclick="StartCompare()">开始对比</i></i></span>
                            </div>
                        </div>
                        <div class="compare-result" style="display: none;" id="result">
                            <div class="result-hd clearfix">
                                <h4><b id="QS">300</b>期对比结果</h4>
                            </div>
                            <div class="result-bd">
                                <ul class="compare-list" id="resultList">
                                </ul>
                            </div>
                        </div>
                        <div>
                            <div class="compare-tips" id="Default">
                                <p class="ta-c">默认系统为您选择了最近300期，请点击“开始对比”</p>
                                <p style="padding: 15px 70px 0"><em class="yellow">小提示：</em>如果您验证的号码经常在历史上经常命中大奖或历史 		上概率极低建议您使用“追号功能”。</p>

                            </div>
                            <div class="compare-tips" style="display: none;" id="check">
                                <p class="ta-c">您选择了<em><span id="checkValue">300</span></em>，请点击“开始对比”</p>
                            </div>
                            <div class="compare-tips" style="display: none;">
                                <p class="ta-c"></p>
                            </div>
                        </div>
                    </div>
                </div>
                <span class="close"></span>
                <span class="new">New!</span>
                <span class="sd"></span>

            </div>

        </div>
    </form>
</body>
</html>
